package team.seekers.hula.course.structure.notice.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import team.seekers.hula.common.annotation.ApiResponseBody;
import team.seekers.hula.course.structure.notice.entity.dto.CourseNoticeDTO;
import team.seekers.hula.course.structure.notice.service.CourseNoticeService;

import javax.annotation.Resource;
import java.util.List;


@Slf4j
@Controller
@ApiResponseBody
@RequestMapping("/course/notice")
public class CourseNoticeController {

    @Resource
    private CourseNoticeService courseNoticeService;


    /**
     * 查询课程所有公告
     */
    @GetMapping("/list")
    public List<CourseNoticeDTO> list(@RequestParam String courseId) {
        return courseNoticeService.queryNoticeByCourseId(courseId);
    }
}
